<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
        .layui-table td, .layui-table th
        {
            min-width: 50px !important;
        }
    </style>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>{$nav}</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
    </div>
    <div class="x-body x-admin">
        
      <xblock>
        <button style="float:left;" class="layui-btn" onclick="x_admin_show('新增页面记录','{:url('Operators/topicLogAdd')}','','600','600')"><i class="layui-icon"></i>新增页面记录</button>
        <div class="layui-card-body" style="padding-left: 0;float:left;padding-left:20px;padding-top:0;">
          <form class="layui-form layui-col-space5" action="" method="get">
            <div class="layui-inline layui-show-xs-block">
                <input style="width:160px;" type="text" name="keyword" id="keyword" value="{:input('keyword')}" placeholder="请输入活动名称、营销姓名" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-inline">
              <label>日期选择</label>
              <div class="layui-input-inline" style="width:80px;">
                <input type="text" name="start_date" id="start_date" value="{if condition="input('start_date')"}{:input('start_date')}{/if}" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <label>至</label>
              <div class="layui-input-inline" style="width:80px;">
                <input type="text" name="end_date" id="end_date" value="{if condition="input('end_date')"}{:input('end_date')}{/if}" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline"  style="width:100px;">
                <select name="admin_id" id="admin_id">
                    <option value="">全部运营</option>
                    {foreach name="staffList" id="value"}
                    <option value="{$value.id}" {if condition="$value.id == input('admin_id')"}selected{/if}>{$value.name}</option>
                    {/foreach}
                </select>
            </div>
            <div class="layui-inline layui-show-xs-block">
                <button class="layui-btn" id="search-btn"><i class="layui-icon"></i></button>
            </div>
            <div class="layui-inline layui-show-xs-block">
                <a href="?my=1" class="layui-btn layui-btn-normal" >我的</a>
            </div>
            <div class="layui-inline">
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m"),date("d"),date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m"),date("d"),date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">今日</a>
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m"),date("d")-1,date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m"),date("d")-1,date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">昨日</a>
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1,date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m"),date("d")-date("w")+7,date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">本周</a>
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m"),date("d")-date("w")+1-7,date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m"),date("d")-date("w")+7-7,date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">上周</a>
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m"),1,date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m"),date("t"),date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">本月</a>
            <a href="?start_date={:date("Y-m-d",mktime(0, 0 , 0,date("m")-1,1,date("Y")))}&end_date={:date("Y-m-d",mktime(23,59,59,date("m") ,0,date("Y")))}" class="layui-btn layui-btn-xs layui-btn-normal">上月</a>
            </div>
          </form>
        </div>
        <span class="x-right" style="line-height:40px">共有记录：{$count}条</span>
      </xblock>
      <div class="layui-table-body layui-table-main" style="width: 100%;">
      <table class="layui-table layui-form">
        <thead>
          <tr>
            <th width="60">编号</th>
            <th>活动名称</th>
            <th width="60">业务</th>
            <th width="60">单页 <i style="color:red"> {$single_count} </i> </th>
            <!--<th width="60">单页</th>-->
            <th width="100">专题(子页面) <i style="color:red">{$topic_count} </i> </th>
            <!--<th width="80">专题(子页面)</th>-->
            <th width="60">所属运营</th>
            <th width="80">制作时间</th>
            {if condition="$_SESSION['admin']['group_id'] == 1"}
            <th width="120">校对结果</th>
            {/if}
            <th width="230" style="text-align: center;">操作</th>
        </thead>
        <tbody>
          {volist name="list" id="value"}
          <tr>
            <td>{$value.id}</td>
            <td>{$value.activity_name}</td>
            <td>{$value.staff_name}</td>
            <td>{$value.single_count}</td>
            <td>{$value.topic_count}</td>
            <td>{:idToAdminname($value.admin_id)}</td>
            <td>{if condition="$value.complete_time"}{$value.complete_time|date="Y-m-d",###}{/if}</td>
            {if condition="$_SESSION['admin']['group_id'] == 1"}
            <td>{:getCheckStatus($value.check_status)}</td>
            {/if}
            <td class="td-manage" style="text-align: center;">
            {if condition="($value.to_admin_id == $_SESSION['admin']['uid']) || $_SESSION['admin']['group_id'] == 1"}
              <a title="营销校对" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('营销校对','{:url('Operators/topicLogCheck')}/id/{$value.id}','','600','600')" href="javascript:;">
                营销校对
              </a>
            {/if}
              <a title="查看" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('查看详情','{:url('Operators/topicLogView')}/id/{$value.id}','','600','600')" href="javascript:;">
                查看
              </a>
              {if condition="$value['admin_id'] eq $_SESSION['admin']['uid'] || $_SESSION['admin']['group_id'] eq 1 "}
              <a title="修改" class="layui-btn layui-btn-normal layui-btn-xs"  onclick="x_admin_show('修改','{:url('Operators/topicLogEdit')}/id/{$value.id}','','600','600')" href="javascript:;">
                修改
              </a>
              <a title="删除" class="layui-btn layui-btn-danger layui-btn-xs" onclick="member_del(this,{$value.id})" href="javascript:;">
                删除
              </a>
              
              {/if}
            </td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
      <div class="page">
        <div>
          {$list->render()}
        </div>
      </div>
    </div>

<script>
layui.use(['form', 'layedit', 'laydate','table','jquery'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,laydate = layui.laydate
  ,table = layui.table
  ,$ = layui.jquery;
   
  laydate.render({
    elem: '#start_date'
  });
  laydate.render({
    elem: '#end_date'
  });
});
function member_del(obj,id){
  layer.confirm('确认要删除吗？',function(index){
      $.ajax({
        type:'POST',
        dataType:'json',
        data:{id:id},
        url:"{:url('Operators/topicLogDel')}",
        success:function(o){
          if(o.icon ==1){
            $(obj).parents("tr").remove();
          }
          layer.msg(o.msg,{icon:o.icon,time:1000});
        }
      });
  });
}
</script>
</body>

</html>